<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div>
        账号:
        <input type="text" id="user">
    </div>
    <div>
        密码:
        <input type="text" id="pass">
    </div>
    <div id="submit">
        提交
    </div>

    <div>
        账号:
        <input type="text" id="loginUser">
    </div>
    <div>
        密码:
        <input type="text" id="loginPass">
    </div>
    <div id="loginSubmit">
        提交
    </div>


</body>
<script src='http://libs.baidu.com/jquery/2.1.1/jquery.min.js'></script>
<script>
    $('#submit').click(function(){
        $.ajax({
            type: "get",
            url: "http://localhost:8080/req",
            data: {
                user:$('#user').val(),
                pass:$('#pass').val()
            },
            dataType: "json",
            success: function (response) {
                console.log(response)
            }
        });        
    })
    $('#loginSubmit').click(function(){
        $.ajax({
            type: "get",
            url: "http://localhost:8080/login",
            data: {
                user:$('#loginUser').val(),
                pass:$('#loginPass').val()
            },
            dataType: "json",
            success: function (response) {
                console.log(response)
            }
        });        
    })
</script>
</html>